package com.more.offer.designpatterns.decorator;


/**
 * @author pinoc
 * @date 2021/10/29
 * @description
 */
public class TestMain {
	public static void main(String[] args) {
		String path = "out/test/OutputDemo.txt";
		String salaryRecords = "Name,Salary\nJohn Smith,100000\nSteven Jobs,912000\nyinpeng";
		AbstractDecorator encoded = new EncryptDecorator(new SimpleDataReadWrite(path));
		encoded.writeData(salaryRecords);

		DataSource plain = new SimpleDataReadWrite(path);

		System.out.println("- Input ----------------");
		System.out.println(salaryRecords);
		System.out.println("- Encoded --------------");
		System.out.println(plain.readData());
		System.out.println("- Decoded --------------");
		System.out.println(encoded.readData());
	}
}
